package com.gxpt.app;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import com.kaopiz.kprogresshud.KProgressHUD;

/**
 * Created by dufeng on 2017/4/19.
 */

public class BaseFragment extends Fragment {

    private Activity activity;
    public KProgressHUD hud;

    public Context getContext(){
        return this.getContext().getApplicationContext();
    }

    @Override
    public void onAttach(Context context) {
        hud = KProgressHUD.create(context)
                .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
                .setLabel(getResources().getString(R.string.alert_progress))
                .setCancellable(true);
        super.onAttach(context);
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        activity = getActivity();
    }



}
